home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / CIncludes / OCE.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-18  |  46.7 KB  |  1,259 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        OCE.h
  3.  
  4.      Contains:    Apple Open Collaboration Environment (AOCE) Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __OCE__
  21. #define __OCE__
  22.  
  23. #ifndef REZ
  24.  
  25. #ifndef __ALIASES__
  26. #include <Aliases.h>
  27. #endif
  28. /*    #include <Types.h>                                            */
  29. /*        #include <ConditionalMacros.h>                            */
  30. /*    #include <AppleTalk.h>                                        */
  31. /*        #include <OSUtils.h>                                    */
  32. /*            #include <MixedMode.h>                                */
  33. /*            #include <Memory.h>                                    */
  34. /*    #include <Files.h>                                            */
  35.  
  36. #ifndef __APPLEEVENTS__
  37. #include <AppleEvents.h>
  38. #endif
  39. /*    #include <Errors.h>                                            */
  40. /*    #include <Events.h>                                            */
  41. /*        #include <Quickdraw.h>                                    */
  42. /*            #include <QuickdrawText.h>                            */
  43. /*    #include <EPPC.h>                                            */
  44. /*        #include <PPCToolbox.h>                                    */
  45. /*        #include <Processes.h>                                    */
  46. /*    #include <Notification.h>                                    */
  47.  
  48. #ifndef __SCRIPT__
  49. #include <Script.h>
  50. #endif
  51. /*    #include <IntlResources.h>                                    */
  52.  
  53. #ifndef __TYPES__
  54. #include <Types.h>
  55. #endif
  56.  
  57. #ifdef __cplusplus
  58. extern "C" {
  59. #endif
  60.  
  61. #if PRAGMA_ALIGN_SUPPORTED
  62. #pragma options align=mac68k
  63. #endif
  64.  
  65. #if PRAGMA_IMPORT_SUPPORTED
  66. #pragma import on
  67. #endif
  68.  
  69.  
  70. enum {
  71.     kOCECopyCreationID            = 768,
  72.     kOCECopyDirDiscriminator    = 769,
  73.     kOCECopyLocalRecordID        = 770,
  74.     kOCECopyPackedDSSpec        = 771,
  75.     kOCECopyPackedPathName        = 772,
  76.     kOCECopyPackedRLI            = 773,
  77.     kOCECopyPackedRecordID        = 774,
  78.     kOCECopyRLI                    = 775,
  79.     kOCECopyRString                = 776,
  80.     kOCECopyRecordID            = 777,
  81.     kOCECopyShortRecordID        = 778,
  82.     kOCEDuplicateRLI            = 779,
  83.     kOCEEqualCreationID            = 780,
  84.     kOCEEqualDirDiscriminator    = 781,
  85.     kOCEEqualDSSpec                = 782,
  86.     kOCEEqualLocalRecordID        = 783,
  87.     kOCEEqualPackedDSSpec        = 784,
  88.     kOCEEqualPackedPathName        = 785,
  89.     kOCEEqualPackedRecordID        = 786,
  90.     kOCEEqualPackedRLI            = 787,
  91.     kOCEEqualRecordID            = 788,
  92.     kOCEEqualRLI                = 789,
  93.     kOCEEqualRString            = 790,
  94.     kOCEEqualShortRecordID        = 791,
  95.     kOCEExtractAlias            = 792,
  96.     kOCEGetDSSpecInfo            = 793,
  97.     kOCEGetIndAttributeType        = 794,
  98.     kOCEGetIndRecordType        = 795,
  99.     kOCEGetXtnType                = 796,
  100.     kOCEIsNullPackedPathName    = 797,
  101.     kOCENewLocalRecordID        = 798,
  102.     kOCENewRLI                    = 799,
  103.     kOCENewRecordID                = 800,
  104.     kOCENewShortRecordID        = 801,
  105.     kOCEPackDSSpec                = 802,
  106.     kOCEPackPathName            = 803,
  107.     kOCEPackRLI                    = 804,
  108.     kOCEPackRLIParts            = 805,
  109.     kOCEPackRecordID            = 806,
  110.     kOCEPackedDSSpecSize        = 807,
  111.     kOCEPackedPathNameSize        = 808,
  112.     kOCEPackedRLIPartsSize        = 809,
  113.     kOCEPackedRLISize            = 810,
  114.     kOCEPackedRecordIDSize        = 811,
  115.     kOCEDNodeNameCount            = 812,
  116.     kOCERelRString                = 813,
  117.     kOCESetCreationIDtoNull        = 814,
  118.     kOCEUnpackDSSpec            = 815,
  119.     kOCEUnpackPathName            = 816,
  120.     kOCEUnpackRLI                = 817,
  121.     kOCEUnpackRecordID            = 818,
  122.     kOCEValidPackedDSSpec        = 819,
  123.     kOCEValidPackedPathName        = 820,
  124.     kOCEValidPackedRecordID        = 821,
  125.     kOCEValidPackedRLI            = 822,
  126.     kOCEValidRLI                = 823,
  127.     kOCEValidRString            = 824,
  128.     kOCECToRString                = 825,
  129.     kOCEPToRString                = 826,
  130.     kOCERToPString                = 827,
  131.     kOCEPathFinderCID            = 828,
  132.     kOCEStreamPackedDSSpec        = 829,
  133.     kOCENullCID                    = 836,
  134.     kOCEGetAccessControlDSSpec    = 837,
  135.     kOCEGetRootPackedRLI        = 838
  136. };
  137.  
  138. typedef unsigned short OCERecordTypeIndex;
  139.  
  140. typedef unsigned short OCEAttributeTypeIndex;
  141.  
  142. #endif /* REZ */
  143. /* For anyone who absolutely needs a define of the body of the standard record or
  144. attribute type, use these below.  CAUTION!  All the types below are assumed to be
  145. in character set 'smRoman'.  If you try to compare these to some RString or
  146. AttributeType variable, you must take the character set code into account.  Future
  147. standard types may be defined using character sets other than 'smRoman'. */
  148. #define kUserRecTypeNum 1
  149. #define kGroupRecTypeNum 2
  150. #define kMnMRecTypeNum 3
  151. #define kMnMForwarderRecTypeNum 4
  152. #define kNetworkSpecRecTypeNum 5
  153. #define kADAPServerRecTypeNum 6
  154. #define kADAPDNodeRecTypeNum 7
  155. #define kADAPDNodeRepRecTypeNum 8
  156. #define kServerSetupRecTypeNum 9
  157. #define kDirectoryRecTypeNum 10
  158. #define kDNodeRecTypeNum 11
  159. #define kSetupRecTypeNum 12
  160. #define kMSAMRecTypeNum 13
  161. #define kDSAMRecTypeNum 14
  162. #define kAttributeValueRecTypeNum 15
  163. #define kBusinessCardRecTypeNum 16
  164. #define kMailServiceRecTypeNum 17
  165. #define kCombinedRecTypeNum 18
  166. #define kOtherServiceRecTypeNum 19
  167. #define kAFPServiceRecTypeNum 20
  168. #define kFirstOCERecTypeNum kUserRecTypeNum
  169. #define kLastOCERecTypeNum kAFPServiceRecTypeNum
  170. #define kNumOCERecTypes (kLastOCERecTypeNum - kFirstOCERecTypeNum + 1)
  171. #define kMemberAttrTypeNum 1001
  172. #define kAdminsAttrTypeNum 1002
  173. #define kMailSlotsAttrTypeNum 1003
  174. #define kPrefMailAttrTypeNum 1004
  175. #define kAddressAttrTypeNum 1005
  176. #define kPictureAttrTypeNum 1006
  177. #define kAuthKeyAttrTypeNum 1007
  178. #define kTelephoneAttrTypeNum 1008
  179. #define kNBPNameAttrTypeNum 1009
  180. #define kQMappingAttrTypeNum 1010
  181. #define kDialupSlotAttrTypeNum 1011
  182. #define kHomeNetAttrTypeNum 1012
  183. #define kCoResAttrTypeNum 1013
  184. #define kFwdrLocalAttrTypeNum 1014
  185. #define kConnectAttrTypeNum 1015
  186. #define kForeignAttrTypeNum 1016
  187. #define kOwnersAttrTypeNum 1017
  188. #define kReadListAttrTypeNum 1018
  189. #define kWriteListAttrTypeNum 1019
  190. #define kDescriptorAttrTypeNum 1020
  191. #define kCertificateAttrTypeNum 1021
  192. #define kMsgQsAttrTypeNum 1022
  193. #define kPrefMsgQAttrTypeNum 1023
  194. #define kMasterPFAttrTypeNum 1024
  195. #define kMasterNetSpecAttrTypeNum 1025
  196. #define kServersOfAttrTypeNum 1026
  197. #define kParentCIDAttrTypeNum 1027
  198. #define kNetworkSpecAttrTypeNum 1028
  199. #define kLocationAttrTypeNum 1029
  200. #define kTimeSvrTypeAttrTypeNum 1030
  201. #define kUpdateTimerAttrTypeNum 1031
  202. #define kShadowsOfAttrTypeNum 1032
  203. #define kShadowServerAttrTypeNum 1033
  204. #define kTBSetupAttrTypeNum 1034
  205. #define kMailSetupAttrTypeNum 1035
  206. #define kSlotIDAttrTypeNum 1036
  207. #define kGatewayFileIDAttrTypeNum 1037
  208. #define kMailServiceAttrTypeNum 1038
  209. #define kStdSlotInfoAttrTypeNum 1039
  210. #define kAssoDirectoryAttrTypeNum 1040
  211. #define kDirectoryAttrTypeNum 1041
  212. #define kDirectoriesAttrTypeNum 1042
  213. #define kSFlagsAttrTypeNum 1043
  214. #define kLocalNameAttrTypeNum 1044
  215. #define kLocalKeyAttrTypeNum 1045
  216. #define kDirUserRIDAttrTypeNum 1046
  217. #define kDirUserKeyAttrTypeNum 1047
  218. #define kDirNativeNameAttrTypeNum 1048
  219. #define kCommentAttrTypeNum 1049
  220. #define kRealNameAttrTypeNum 1050
  221. #define kPrivateDataAttrTypeNum 1051
  222. #define kDirTypeAttrTypeNum 1052
  223. #define kDSAMFileAliasAttrTypeNum 1053
  224. #define kCanAddressToAttrTypeNum 1054
  225. #define kDiscriminatorAttrTypeNum 1055
  226. #define kAliasAttrTypeNum 1056
  227. #define kParentMSAMAttrTypeNum 1057
  228. #define kParentDSAMAttrTypeNum 1058
  229. #define kSlotAttrTypeNum 1059
  230. #define kAssoMailServiceAttrTypeNum 1060
  231. #define kFakeAttrTypeNum 1061
  232. #define kInheritSysAdminAttrTypeNum 1062
  233. #define kPreferredPDAttrTypeNum 1063
  234. #define kLastLoginAttrTypeNum 1064
  235. #define kMailerAOMStateAttrTypeNum 1065
  236. #define kMailerSendOptionsAttrTypeNum 1066
  237. #define kJoinedAttrTypeNum 1067
  238. #define kUnconfiguredAttrTypeNum 1068
  239. #define kVersionAttrTypeNum 1069
  240. #define kLocationNamesAttrTypeNum 1070
  241. #define kActiveAttrTypeNum 1071
  242. #define kDeleteRequestedAttrTypeNum 1072
  243. #define kGatewayTypeAttrTypeNum 1073
  244. #define kFirstOCEAttrTypeNum kMemberAttrTypeNum
  245. #define kLastOCEAttrTypeNum kGatewayTypeAttrTypeNum
  246. #define kNumOCEAttrTypes (kLastOCEAttrTypeNum - kFirstOCEAttrTypeNum + 1)
  247. #define kUserRecTypeBody "aoce User"
  248. #define kGroupRecTypeBody "aoce Group"
  249. #define kMnMRecTypeBody "aoce AppleMail™ M&M"
  250. #define kMnMForwarderRecTypeBody "aoce AppleMail™ Fwdr"
  251. #define kNetworkSpecRecTypeBody "aoce NetworkSpec"
  252. #define kADAPServerRecTypeBody "aoce ADAP Server"
  253. #define kADAPDNodeRecTypeBody "aoce ADAP DNode"
  254. #define kADAPDNodeRepRecTypeBody "aoce ADAP DNode Rep"
  255. #define kServerSetupRecTypeBody "aoce Server Setup"
  256. #define kDirectoryRecTypeBody "aoce Directory"
  257. #define kDNodeRecTypeBody "aoce DNode"
  258. #define kSetupRecTypeBody "aoce Setup"
  259. #define kMSAMRecTypeBody "aoce MSAM"
  260. #define kDSAMRecTypeBody "aoce DSAM"
  261. #define kAttributeValueRecTypeBody "aoce Attribute Value"
  262. #define kBusinessCardRecTypeBody "aoce Business Card"
  263. #define kMailServiceRecTypeBody "aoce Mail Service"
  264. #define kCombinedRecTypeBody "aoce Combined"
  265. #define kOtherServiceRecTypeBody "aoce Other Service"
  266. #define kAFPServiceRecTypeBody "aoce Other Service afps"
  267. #define kMemberAttrTypeBody "aoce Member"
  268. #define kAdminsAttrTypeBody "aoce Administrators"
  269. #define kMailSlotsAttrTypeBody "aoce mailslots"
  270. #define kPrefMailAttrTypeBody "aoce pref mailslot"
  271. #define kAddressAttrTypeBody "aoce Address"
  272. #define kPictureAttrTypeBody "aoce Picture"
  273. #define kAuthKeyAttrTypeBody "aoce auth key"
  274. #define kTelephoneAttrTypeBody "aoce Telephone"
  275. #define kNBPNameAttrTypeBody "aoce NBP Name"
  276. #define kQMappingAttrTypeBody "aoce ForwarderQMap"
  277. #define kDialupSlotAttrTypeBody "aoce DialupSlotInfo"
  278. #define kHomeNetAttrTypeBody "aoce Home Internet"
  279. #define kCoResAttrTypeBody "aoce Co-resident M&M"
  280. #define kFwdrLocalAttrTypeBody "aoce FwdrLocalRecord"
  281. #define kConnectAttrTypeBody "aoce Connected To"
  282. #define kForeignAttrTypeBody "aoce Foreign RLIs"
  283. #define kOwnersAttrTypeBody "aoce Owners"
  284. #define kReadListAttrTypeBody "aoce ReadList"
  285. #define kWriteListAttrTypeBody "aoce WriteList"
  286. #define kDescriptorAttrTypeBody "aoce Descriptor"
  287. #define kCertificateAttrTypeBody "aoce Certificate"
  288. #define kMsgQsAttrTypeBody "aoce MessageQs"
  289. #define kPrefMsgQAttrTypeBody "aoce PrefMessageQ"
  290. #define kMasterPFAttrTypeBody "aoce MasterPF"
  291. #define kMasterNetSpecAttrTypeBody "aoce MasterNetSpec"
  292. #define kServersOfAttrTypeBody "aoce Servers Of"
  293. #define kParentCIDAttrTypeBody "aoce Parent CID"
  294. #define kNetworkSpecAttrTypeBody "aoce NetworkSpec"
  295. #define kLocationAttrTypeBody "aoce Location"
  296. #define kTimeSvrTypeAttrTypeBody "aoce TimeServer Type"
  297. #define kUpdateTimerAttrTypeBody "aoce Update Timer"
  298. #define kShadowsOfAttrTypeBody "aoce Shadows Of"
  299. #define kShadowServerAttrTypeBody "aoce Shadow Server"
  300. #define kTBSetupAttrTypeBody "aoce TB Setup"
  301. #define kMailSetupAttrTypeBody "aoce Mail Setup"
  302. #define kSlotIDAttrTypeBody "aoce SlotID"
  303. #define kGatewayFileIDAttrTypeBody "aoce Gateway FileID"
  304. #define kMailServiceAttrTypeBody "aoce Mail Service"
  305. #define kStdSlotInfoAttrTypeBody "aoce Std Slot Info"
  306. #define kAssoDirectoryAttrTypeBody "aoce Asso. Directory"
  307. #define kDirectoryAttrTypeBody "aoce Directory"
  308. #define kDirectoriesAttrTypeBody "aoce Directories"
  309. #define kSFlagsAttrTypeBody "aoce SFlags"
  310. #define kLocalNameAttrTypeBody "aoce Local Name"
  311. #define kLocalKeyAttrTypeBody "aoce Local Key"
  312. #define kDirUserRIDAttrTypeBody "aoce Dir User RID"
  313. #define kDirUserKeyAttrTypeBody "aoce Dir User Key"
  314. #define kDirNativeNameAttrTypeBody "aoce Dir Native Name"
  315. #define kCommentAttrTypeBody "aoce Comment"
  316. #define kRealNameAttrTypeBody "aoce Real Name"
  317. #define kPrivateDataAttrTypeBody "aoce Private Data"
  318. #define kDirTypeAttrTypeBody "aoce Directory Type"
  319. #define kDSAMFileAliasAttrTypeBody "aoce DSAM File Alias"
  320. #define kCanAddressToAttrTypeBody "aoce Can Address To"
  321. #define kDiscriminatorAttrTypeBody "aoce Discriminator"
  322. #define kAliasAttrTypeBody "aoce Alias"
  323. #define kParentMSAMAttrTypeBody "aoce Parent MSAM"
  324. #define kParentDSAMAttrTypeBody "aoce Parent DSAM"
  325. #define kSlotAttrTypeBody "aoce Slot"
  326. #define kAssoMailServiceAttrTypeBody "aoce Asso. Mail Service"
  327. #define kFakeAttrTypeBody "aoce Fake"
  328. #define kInheritSysAdminAttrTypeBody "aoce Inherit SysAdministrators"
  329. #define kPreferredPDAttrTypeBody "aoce Preferred PD"
  330. #define kLastLoginAttrTypeBody "aoce Last Login"
  331. #define kMailerAOMStateAttrTypeBody "aoce Mailer AOM State"
  332. #define kMailerSendOptionsAttrTypeBody "aoce Mailer Send Options"
  333. #define kJoinedAttrTypeBody "aoce Joined"
  334. #define kUnconfiguredAttrTypeBody "aoce Unconfigured"
  335. #define kVersionAttrTypeBody "aoce Version"
  336. #define kLocationNamesAttrTypeBody "aoce Location Names"
  337. #define kActiveAttrTypeBody "aoce Active"
  338. #define kDeleteRequestedAttrTypeBody "aoce Delete Requested"
  339. #define kGatewayTypeAttrTypeBody "aoce Gateway Type"
  340. #ifndef REZ
  341. /* Miscellaneous enums: */
  342.  
  343. enum {
  344.     kRString32Size                = 32,                            /* max size of the body field in RString32 */
  345.     kRString64Size                = 64,                            /* max size of the body field in RString64 */
  346.     kNetworkSpecMaxBytes        = 32,                            /* max size of the body field in NetworkSpec */
  347.     kPathNameMaxBytes            = 1024,                            /* max size of the data field in PackedPathName */
  348.     kDirectoryNameMaxBytes        = 32,                            /* max size of the body field in DirectoryName */
  349.     kAttributeTypeMaxBytes        = 32,                            /* max size of the body field in AttributeType */
  350.     kAttrValueMaxBytes            = 65536,                        /* max size of any attribute value */
  351.     kRStringMaxBytes            = 256,                            /* max size (in bytes) of the body field of a recordName or recordType */
  352.     kRStringMaxChars            = 128                            /* max size (in chars) of the body field of a recordName or recordType */
  353. };
  354.  
  355. enum {
  356.     kNULLDNodeNumber            = 0,                            /* Special value meaning none specified */
  357.     kRootDNodeNumber            = 2                                /* DNodeNum corresponding to the root of the tree */
  358. };
  359.  
  360. /* This enum is used to select the kind of RString in calls such as OCERelRString,
  361. OCEEqualRString, and OCEValidRString.
  362.  
  363. eGenericSensitive and eGenericInsensitive are enumerators that can be used if you
  364. use RStrings for things other than what you see in this file.  If you want them to
  365. be compared in a case- and diacritical-sensitive manner (c ≠ C ≠ ç), use
  366. eGenericSensitive.  If you want them to be compared in a case- and diacritical-
  367. insensitive manner (c = C = ç), use eGenericInensitive.
  368. WARNING:  do not use eGenericSensitive and eGenericInsensitive with catalog
  369. names, entity names, pathname parts, entity types, network specs, or attribute
  370. types!  Don't assume that you know how they should be compared!!! */
  371. enum {
  372.     kOCEDirName                    = 0,
  373.     kOCERecordOrDNodeName        = 1,
  374.     kOCERecordType                = 2,
  375.     kOCENetworkSpec                = 3,
  376.     kOCEAttrType                = 4,
  377.     kOCEGenericSensitive        = 5,
  378.     kOCEGenericInsensitive        = 6
  379. };
  380.  
  381. typedef unsigned short RStringKind;
  382.  
  383. /* Values for the signature field in Discriminator */
  384.  
  385. enum {
  386.     kDirAllKinds                = 0,
  387.     kDirADAPKind                = 'adap',
  388.     kDirPersonalDirectoryKind    = 'pdir',
  389.     kDirDSAMKind                = 'dsam'
  390. };
  391.  
  392. typedef unsigned long OCEDirectoryKind;
  393.  
  394. /* Values returned by GetDSSpecInfo() */
  395.  
  396. enum {
  397.     kOCEInvalidDSSpec            = 0x3F3F3F3FL,                    /* could not be determined */
  398.     kOCEDirsRootDSSpec            = 'root',                        /* root of all catalogs ("Catalogs" icon) */
  399.     kOCEDirectoryDSSpec            = 'dire',                        /* catalog */
  400.     kOCEDNodeDSSpec                = 'dnod',                        /* d-node */
  401.     kOCERecordDSSpec            = 'reco',                        /* record */
  402.     kOCEentnDSSpec                = 'entn',                        /* extensionType is 'entn' */
  403.     kOCENOTentnDSSpec            = 'not '
  404. };
  405.  
  406. /* Values for AttributeTag */
  407. enum {
  408.     typeRString                    = 'rstr',
  409.     typePackedDSSpec            = 'dspc',
  410.     typeBinary                    = 'bnry'
  411. };
  412.  
  413. /* Bit flag corresponding to the canContainRecords bit.  Use it like this:
  414.     if (foo & kCanContainRecords)
  415.         then this dNode can contain records!
  416. kForeignNode is used to indicate nodes in the name hierarchy that correspond to
  417. foreign catalogs (meaning ADAP sees no clusters or DNodes beneath it, but
  418. mail routers might be able to route to clusters beneath it. */
  419. enum {
  420.     kCanContainRecordsBit,
  421.     kForeignNodeBit
  422. };
  423.  
  424. /* DirNodeKind */
  425. enum {
  426.     kCanContainRecords            = 1L << kCanContainRecordsBit,
  427.     kForeignNode                = 1L << kForeignNodeBit
  428. };
  429.  
  430. typedef unsigned long DirNodeKind;
  431.  
  432. /**** Toolbox Control ****/
  433. /* We will have a version number and attributes for toolboxes off the aa5e trap
  434. and the S&F server trap.
  435.  
  436. This includes the OCE toolbox and S&F Server.  [Note: the S&F server will
  437. change to ONLY service ServerGateway calls —it will then be necessary to run
  438. it co–resident with an OCE toolbox].
  439.  
  440. The high order word will represent the S&F Server version number.  The low
  441. order word will represent the OCE toolbox version number.  These will be zero
  442. until the component is up and running.  It is not possible to know these
  443. a–priori. Note: there will not be a seperate version numbers for each component
  444. in the OCE toolbox or S&F server.
  445.  
  446. The above is consistent with the standard System 7.0 usage of Gestalt.
  447.  
  448. The oce tb attribute gestaltOCETBPresent implies the existence of OCE on a
  449. machine.
  450.  
  451. The OCE TB attribute gestaltOCETBAvailable implies the availablity of OCE calls.
  452.  
  453. The attribute gestaltOCESFServerAvailable implies the availablity of OCE calls
  454. available through the S&F server. This are essentially the server gateway calls.
  455.  
  456. Any (future) remaining OCE attributes may not be established correctly until
  457. the attribute gestaltOCETBAvailable is set.
  458.  
  459. The gestalt selectors and values are listed below: */
  460.  
  461. enum {
  462.     gestaltOCEToolboxVersion    = 'ocet',                        /* OCE Toolbox version */
  463.     gestaltOCEToolboxAttr        = 'oceu'
  464. };
  465.  
  466. enum {
  467. /* version includes:
  468.  *  dirtb
  469.  *  authtb
  470.  *  mailtb
  471.  *  ipmtb
  472.  *  personal catalog
  473.  *  ADSPSecure
  474.  * e.g. all interfaces dependent on the aa5e trap. */
  475.     gestaltOCETB                = 0x0102,                        /* OCE Toolbox version 1.02 */
  476.     gestaltSFServer                = 0x0100,                        /* S&F Server version 1.0 */
  477.     gestaltOCETBPresent            = 0x01,                            /* OCE toolbox is present, not running */
  478.     gestaltOCETBAvailable        = 0x02,                            /* OCE toolbox is running and available */
  479.     gestaltOCESFServerAvailable    = 0x04,                            /* S&F Server is running and available */
  480.     gestaltOCETBNativeGlueAvailable = 0x10                        /* Native PowerPC Glue routines are availible */
  481. };
  482.  
  483. /*    Constants used for Transitions. */
  484. enum {
  485.     ATTransIPMStart                = 'ipms',
  486.     ATTransIPMShutdown            = 'ipmd',
  487.     ATTransDirStart                = 'dirs',
  488.     ATTransDirShutdown            = 'dird',
  489.     ATTransAuthStart            = 'auts',
  490.     ATTransAuthShutdown            = 'autd',
  491.     ATTransSFStart                = 's&fs',
  492.     ATTransSFShutdown            = 's&fd'
  493. };
  494.  
  495. /* Some definitions for time-related parameters: */
  496. /* Interpreted as UTC seconds since 1/1/1904 */
  497. typedef unsigned long UTCTime;
  498.  
  499. /* seconds EAST of Greenwich */
  500. typedef long UTCOffset;
  501.  
  502. /* This is the same as the ScriptManager script. */
  503. typedef short CharacterSet;
  504.  
  505. /**** RString ****/
  506. /* struct RString is a maximum-sized structure.  Allocate one of these and it will
  507. hold any valid RString. */
  508. #define RStringHeader             \
  509.     CharacterSet charSet;            \
  510.     unsigned short dataLength;
  511. struct RString {
  512.     CharacterSet                    charSet;
  513.     unsigned short                    dataLength;
  514.     Byte                            body[kRStringMaxBytes];        /* place for characters */
  515. };
  516.  
  517. typedef struct RString RString;
  518.  
  519. /* struct ProtoRString is a minimum-sized structure.  Use this for a variable-length RString. */
  520. struct ProtoRString {
  521.     CharacterSet                    charSet;
  522.     unsigned short                    dataLength;
  523. };
  524.  
  525. typedef struct ProtoRString ProtoRString;
  526.  
  527. typedef RString *RStringPtr, **RStringHandle;
  528.  
  529. typedef ProtoRString *ProtoRStringPtr;
  530.  
  531. struct RString64 {
  532.     CharacterSet                    charSet;
  533.     unsigned short                    dataLength;
  534.     Byte                            body[kRString64Size];
  535. };
  536.  
  537. typedef struct RString64 RString64;
  538.  
  539. struct RString32 {
  540.     CharacterSet                    charSet;
  541.     unsigned short                    dataLength;
  542.     Byte                            body[kRString32Size];
  543. };
  544.  
  545. typedef struct RString32 RString32;
  546.  
  547. /* Standard definitions for the entity type field and attribute type
  548. have been moved to the end of the file. */
  549. /* Copies str1 to str2.  str2Length is the size of str2, excluding header.
  550. A memFull error will be returned if that is not as large as str1->dataLength. */
  551. extern pascal OSErr OCECopyRString(const RString *str1, RString *str2, unsigned short str2Length)
  552.  THREEWORDINLINE(0x303C, 776, 0xAA5C);
  553. /*    Make an RString from a C string.  If the c string is bigger than rStrLength,
  554. only rStrLength bytes will be copied. (rStrLength does not include the header size) */
  555. extern pascal void OCECToRString(const char *cStr, CharacterSet charSet, RString *rStr, unsigned short rStrLength)
  556.  THREEWORDINLINE(0x303C, 825, 0xAA5C);
  557. /*    Make an RString from a Pascal string.  If the Pascal string is bigger than rStrLength,
  558. only rStrLength bytes will be copied. (rStrLength does not include the header size) */
  559. extern pascal void OCEPToRString(ConstStr255Param pStr, CharacterSet charSet, RString *rStr, unsigned short rStrLength)
  560.  THREEWORDINLINE(0x303C, 826, 0xAA5C);
  561. /*    Make a Pascal string from an RString.  It's up to you to check the char set of
  562. the RString, or if the length of the RString is greater than 255 (the Pascal string's
  563. length will simply be the lower byte of the RString's length).  The StringPtr that is
  564. returned will point directly into the RString (no memory will be allocated). */
  565. extern pascal StringPtr OCERToPString(const RString *rStr)
  566.  THREEWORDINLINE(0x303C, 827, 0xAA5C);
  567. /*    Check the relative equality of two RStrings.  Determines if str1 is greater than,
  568. equal to, or less than str2.  Result types for OCERelRString are defined in <OSUtils.h>
  569. (same as for RelString). */
  570. extern pascal short OCERelRString(const void *str1, const void *str2, RStringKind kind)
  571.  THREEWORDINLINE(0x303C, 813, 0xAA5C);
  572. /*    Check for equality of two RStrings. Returns true if equal. */
  573. extern pascal Boolean OCEEqualRString(const void *str1, const void *str2, RStringKind kind)
  574.  THREEWORDINLINE(0x303C, 790, 0xAA5C);
  575. /*    Check the validity of an RString.  Returns true if the RString is valid */
  576. extern pascal Boolean OCEValidRString(const void *str, RStringKind kind)
  577.  THREEWORDINLINE(0x303C, 824, 0xAA5C);
  578. /**** CreationID ****/
  579. struct CreationID {
  580.     unsigned long                    source;                        /* Fields definitions and usage are not defined */
  581.     unsigned long                    seq;
  582. };
  583.  
  584. typedef struct CreationID CreationID;
  585.  
  586. typedef CreationID AttributeCreationID;
  587.  
  588. /* Returns a pointer to a null CreationID . */
  589. extern pascal const CreationID *OCENullCID(void)
  590.  THREEWORDINLINE(0x303C, 836, 0xAA5C);
  591. /* Returns a pointer to a special CreationID used within the PathFinder. */
  592. extern pascal const CreationID *OCEPathFinderCID(void)
  593.  THREEWORDINLINE(0x303C, 828, 0xAA5C);
  594. /* Sets the CreationID to a null value. */
  595. extern pascal void OCESetCreationIDtoNull(CreationID *cid)
  596.  THREEWORDINLINE(0x303C, 814, 0xAA5C);
  597. /* Copies the value of cid1 to cid2. */
  598. extern pascal void OCECopyCreationID(const CreationID *cid1, CreationID *cid2)
  599.  THREEWORDINLINE(0x303C, 768, 0xAA5C);
  600. /* Check the equality of two CreationIDs. */
  601. extern pascal Boolean OCEEqualCreationID(const CreationID *cid1, const CreationID *cid2)
  602.  THREEWORDINLINE(0x303C, 780, 0xAA5C);
  603. /**** NetworkSpec ****/
  604. /* For the record, a NetworkSpec is an RString with a smaller maximum size.
  605. I don't just typedef it to an RString, because I want the definition of the NetworkSpec
  606. struct to contain the max length.  But it should be possible to typecast any
  607. NetworkSpec to an RString and use all the RString utilities on it. */
  608. struct NetworkSpec {
  609.     CharacterSet                    charSet;
  610.     unsigned short                    dataLength;
  611.     Byte                            body[kNetworkSpecMaxBytes];    /* always fixed at the max size */
  612. };
  613.  
  614. typedef struct NetworkSpec NetworkSpec;
  615.  
  616. typedef NetworkSpec *NetworkSpecPtr;
  617.  
  618. /**** PackedPathName ****/
  619. /* struct PackedPathName is a maximum-sized structure.  Allocate one of
  620. these and it will hold any valid packed pathname. */
  621. #define PackedPathNameHeader     \
  622.     unsigned short dataLength;
  623. struct PackedPathName {
  624.     unsigned short                    dataLength;
  625.     Byte                            data[kPathNameMaxBytes - 2];
  626. };
  627.  
  628. typedef struct PackedPathName PackedPathName;
  629.  
  630. /* struct ProtoPackedPathName is a minimum-sized structure.  Use this
  631. for a variable-length packed PathName. */
  632. struct ProtoPackedPathName {
  633.     unsigned short                    dataLength;
  634. };
  635.  
  636. typedef struct ProtoPackedPathName ProtoPackedPathName;
  637.  
  638. typedef PackedPathName *PackedPathNamePtr;
  639.  
  640. typedef ProtoPackedPathName *ProtoPackedPathNamePtr;
  641.  
  642. /*
  643. Copy the contents of path1 to path2.  path2Length is the size of path2, and must
  644. be large enough to hold a copy of path1.  A memFull error will be returned if that
  645. is not the case.
  646. */
  647. extern pascal OSErr OCECopyPackedPathName(const PackedPathName *path1, PackedPathName *path2, unsigned short path2Length)
  648.  THREEWORDINLINE(0x303C, 772, 0xAA5C);
  649. /*
  650. Returns true if packed path pointer is nil, or is of zero length, or is of
  651. length 2 and nParts of zero.
  652. */
  653. extern pascal Boolean OCEIsNullPackedPathName(const PackedPathName *path)
  654.  THREEWORDINLINE(0x303C, 797, 0xAA5C);
  655. /*
  656. OCEUnpackPathName breaks apart the path into its component RStrings, writing string
  657. pointers into the array 'parts', which the client asserts can hold as many as
  658. 'nParts' elements. The number of parts actually found is returned.  Strings are
  659. placed in the array in order from lowest to highest.  The first pathName element
  660. beneath the root appears last.  NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO
  661. THE PACKED STRUCT - DON'T DELETE OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED
  662. WITH THE UNPACKED STRUCT AS WELL
  663. */
  664. extern pascal unsigned short OCEUnpackPathName(const PackedPathName *path, RString *parts[], unsigned short nParts)
  665.  THREEWORDINLINE(0x303C, 816, 0xAA5C);
  666. extern pascal unsigned short OCEPackedPathNameSize(const RStringPtr parts[], unsigned short nParts)
  667.  THREEWORDINLINE(0x303C, 808, 0xAA5C);
  668. extern pascal unsigned short OCEDNodeNameCount(const PackedPathName *path)
  669.  THREEWORDINLINE(0x303C, 812, 0xAA5C);
  670. /*
  671. OCEPackPathName packs the parts into the storage provided as 'path'.  path must be
  672. large enough to hold the packed pathname.  A memFull error will be returned if
  673. pathLength is too small.  parts[0] should contain the deepest pathName element,
  674. and parts[nParts - 1] should contain the name of the first pathName element beneath
  675. the root. 
  676. */
  677. extern pascal OSErr OCEPackPathName(const RStringPtr parts[], unsigned short nParts, PackedPathName *path, unsigned short pathLength)
  678.  THREEWORDINLINE(0x303C, 803, 0xAA5C);
  679. extern pascal Boolean OCEEqualPackedPathName(const PackedPathName *path1, const PackedPathName *path2)
  680.  THREEWORDINLINE(0x303C, 785, 0xAA5C);
  681. /*
  682. OCEValidPackedPathName checks that the packed PathName is internally consistent.
  683. Returns true if it's ok.
  684. */
  685. extern pascal Boolean OCEValidPackedPathName(const PackedPathName *path)
  686.  THREEWORDINLINE(0x303C, 820, 0xAA5C);
  687. /**** DirDiscriminator ****/
  688. struct DirDiscriminator {
  689.     OCEDirectoryKind                signature;
  690.     unsigned long                    misc;
  691. };
  692.  
  693. typedef struct DirDiscriminator DirDiscriminator;
  694.  
  695. /* Copies the value of disc1 to disc2. */
  696. extern pascal void OCECopyDirDiscriminator(const DirDiscriminator *disc1, DirDiscriminator *disc2)
  697.  THREEWORDINLINE(0x303C, 769, 0xAA5C);
  698. /* Check the equality of two DirDiscriminators. */
  699. extern pascal Boolean OCEEqualDirDiscriminator(const DirDiscriminator *disc1, const DirDiscriminator *disc2)
  700.  THREEWORDINLINE(0x303C, 781, 0xAA5C);
  701. /*
  702. This structure is called RLI because it really contains all the info you
  703. need to locate a record within the entire name space.  It contains four fields.
  704. The first two are the name of the catalog and a catalog discriminator.  These
  705. two fields are used to indicate to which catalog a given record belongs.  The
  706. discriminator is used to distinguish between two different catalogs that have
  707. the same name.
  708.  
  709. The other two fields in the RLI structure are used to indicate a particular
  710. catalog node within the catalog specified by the directoryName and
  711. discriminator fields.  These fields are exactly analagous to the dirID and
  712. pathname used in HFS.  It is possible to specify a dNode just by dNodeNumber
  713. (pathname is nil), or just by pathname (dNodeNumber is set to kNULLDNodeNumber),
  714. or by a combination of the two.  The latter is called a 'partial pathname', and
  715. while it is valid in the Catalog Manager API, it is not supported by ADAP
  716. catalogs in Release 1.
  717.  
  718. Note that the path parameter does not include the catalog name, but holds
  719. the names of all the nodes on the path to the desired catalog node, starting
  720. with the catalog node and working its way up the tree.
  721. */
  722. /**** RLI ****/
  723. struct DirectoryName {
  724.     CharacterSet                    charSet;
  725.     unsigned short                    dataLength;
  726.     Byte                            body[kDirectoryNameMaxBytes]; /* space for catalog name */
  727. };
  728.  
  729. typedef struct DirectoryName DirectoryName;
  730.  
  731. typedef DirectoryName *DirectoryNamePtr;
  732.  
  733. /* Catalog node number */
  734. typedef unsigned long DNodeNum;
  735.  
  736. struct RLI {
  737.     DirectoryNamePtr                directoryName;                /* pointer to the name of the catalog root */
  738.     DirDiscriminator                discriminator;                /* used to discriminate between dup catalog names */
  739.     DNodeNum                        dNodeNumber;                /* number of the node */
  740.     PackedPathNamePtr                path;                        /* old-style RLI */
  741. };
  742.  
  743. typedef struct RLI RLI;
  744.  
  745. typedef RLI *RLIPtr;
  746.  
  747. /*
  748. Create a new RLI from the catalog name, discriminator, DNode number, and
  749. PackedPathName.  You must allocate the storage for the RLI and pass in a pointer
  750. to it.
  751. */
  752. extern pascal void OCENewRLI(RLI *newRLI, const DirectoryName *dirName, DirDiscriminator *discriminator, DNodeNum dNodeNumber, const PackedPathName *path)
  753.  THREEWORDINLINE(0x303C, 799, 0xAA5C);
  754. /*
  755. Duplicate the contents of rli1 to rli2.  No errors are returned. This
  756. simply copies the pointers to the catalog name and path, wiping out any pointer
  757. that you might have had in there.
  758. */
  759. extern pascal void OCEDuplicateRLI(const RLI *rli1, RLI *rli2)
  760.  THREEWORDINLINE(0x303C, 779, 0xAA5C);
  761. /*
  762. Copy the contents of rli1 to rli2.  rli2 must already contain
  763. pointers to structures large enough to hold copies of the corresponding
  764. fields from rli1.  A memFull error will be returned if that is not the case.
  765. So if you allocate a brand new empty destination, you must at least set up
  766. its length fields.
  767. */
  768. extern pascal OSErr OCECopyRLI(const RLI *rli1, RLI *rli2)
  769.  THREEWORDINLINE(0x303C, 775, 0xAA5C);
  770. /*
  771. Check the equality of two RLIs.  This will take into account differences
  772. in the case and diacriticals of the directoryName and the PathName.
  773. NOTE THAT THIS WILL FAIL IF rli1 CONTAINS A DNODENUMBER AND A NIL PATHNAME,
  774. AND rli2 CONTAINS kNULLDNodeNumber AND A NON-NIL PATHNAME.  IN OTHER WORDS,
  775. THE TWO rlis MUST BE OF THE SAME FORM TO CHECK FOR EQUALITY.
  776. The one exception is that if the pathname is nil, a dNodeNumber of zero and
  777. kRootDNodeNumber will be treated as equal.
  778. */
  779. extern pascal Boolean OCEEqualRLI(const RLI *rli1, const RLI *rli2)
  780.  THREEWORDINLINE(0x303C, 789, 0xAA5C);
  781. /*
  782. Check the validity of an RLI.  This checks that the catalog name length
  783. is within bounds, and the packed pathname (if specified) is valid.
  784. */
  785. extern pascal Boolean OCEValidRLI(const RLI *theRLI)
  786.  THREEWORDINLINE(0x303C, 823, 0xAA5C);
  787. /**** PackedRLI ****/
  788. /*
  789. struct PackedRLI is a maximum-sized structure.  Allocate one of
  790. these and it will hold any valid packed pathname.
  791. */
  792. #define PackedRLIHeader         \
  793.     unsigned short dataLength;
  794.  
  795. enum {
  796.     kRLIMaxBytes                = (sizeof(RString) + sizeof(DirDiscriminator) + sizeof(DNodeNum) + kPathNameMaxBytes)
  797. };
  798.  
  799. struct PackedRLI {
  800.     unsigned short                    dataLength;
  801.     Byte                            data[kRLIMaxBytes];
  802. };
  803.  
  804. typedef struct PackedRLI PackedRLI;
  805.  
  806. /*
  807. struct ProtoPackedRLI is a minimum-sized structure.  Use this
  808. for a variable-length packed RLI.
  809. */
  810. struct ProtoPackedRLI {
  811.     unsigned short                    dataLength;
  812. };
  813.  
  814. typedef struct ProtoPackedRLI ProtoPackedRLI;
  815.  
  816. typedef PackedRLI *PackedRLIPtr;
  817.  
  818. typedef ProtoPackedRLI *ProtoPackedRLIPtr;
  819.  
  820. /*
  821. Copy the contents of prli1 to prli2.  prli2Length is the size of prli2, and must
  822. be large enough to hold a copy of prli1.  A memFull error will be returned if that
  823. is not the case.
  824. */
  825. extern pascal OSErr OCECopyPackedRLI(const PackedRLI *prli1, PackedRLI *prli2, unsigned short prli2Length)
  826.  THREEWORDINLINE(0x303C, 773, 0xAA5C);
  827. /*
  828. OCEUnpackRLI breaks apart the prli into its components, writing pointers into
  829. the rli structure.  NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE
  830. PACKED STRUCT - DON'T DELETE OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED
  831. WITH THE UNPACKED STRUCT AS WELL
  832. */
  833. extern pascal void OCEUnpackRLI(const PackedRLI *prli, RLI *theRLI)
  834.  THREEWORDINLINE(0x303C, 817, 0xAA5C);
  835. /*
  836. OCEPackedRLISize computes the number of bytes of memory needed to hold a
  837. PackedRLI manufactured from an RLI.  This length
  838. includes the length of the length field of PackedRLI, so it
  839. is safe to do a NewPtr (OCEPackedRLISize(...)).
  840. */
  841. extern pascal unsigned short OCEPackedRLISize(const RLI *theRLI)
  842.  THREEWORDINLINE(0x303C, 810, 0xAA5C);
  843. /*
  844. OCEPackRLI packs the RLI into the storage provided as 'prli'.  prli must be
  845. large enough to hold the packed RLI.  A memFull error will be returned if
  846. prliLength is too small.
  847. */
  848. extern pascal OSErr OCEPackRLI(const RLI *theRLI, PackedRLI *prli, unsigned short prliLength)
  849.  THREEWORDINLINE(0x303C, 804, 0xAA5C);
  850. /*
  851. OCEPackedRLIPartsSize computes the number of bytes of memory needed to hold a
  852. PackedRLI manufactured from the parts of an RLI.  This length
  853. includes the length of the length field of PackedRLI, so it
  854. is safe to do a NewPtr (OCEPackedRLIPartsSize(...)).
  855. */
  856. extern pascal unsigned short OCEPackedRLIPartsSize(const DirectoryName *dirName, const RStringPtr parts[], unsigned short nParts)
  857.  THREEWORDINLINE(0x303C, 809, 0xAA5C);
  858. extern pascal OSErr OCEPackRLIParts(const DirectoryName *dirName, const DirDiscriminator *discriminator, DNodeNum dNodeNumber, const RStringPtr parts[], unsigned short nParts, PackedRLI *prli, unsigned short prliLength)
  859.  THREEWORDINLINE(0x303C, 805, 0xAA5C);
  860. extern pascal Boolean OCEEqualPackedRLI(const PackedRLI *prli1, const PackedRLI *prli2)
  861.  THREEWORDINLINE(0x303C, 787, 0xAA5C);
  862. /*
  863. Check the validity of a packed RLI.  This checks that the catalog name length
  864. is within bounds, and the packed pathname (if specified) is valid.
  865. */
  866. extern pascal Boolean OCEValidPackedRLI(const PackedRLI *prli)
  867.  THREEWORDINLINE(0x303C, 822, 0xAA5C);
  868. /*
  869. If this packed RLI describes a Personal Catalog, this call will return a pointer
  870. to an alias record that can be used to find the actual file.  Otherwise, it returns nil.
  871. */
  872. extern pascal AliasPtr OCEExtractAlias(const PackedRLI *prli)
  873.  THREEWORDINLINE(0x303C, 792, 0xAA5C);
  874. /*
  875. This call returns a pointer to a packed RLI that represents the "Catalogs" icon, or
  876. the root of all catalogs.  It is used in the CollabPack.
  877. */
  878. extern pascal const PackedRLI *OCEGetDirectoryRootPackedRLI(void)
  879.  THREEWORDINLINE(0x303C, 838, 0xAA5C);
  880. /**** LocalRecordID ****/
  881. struct LocalRecordID {
  882.     CreationID                        cid;
  883.     RStringPtr                        recordName;
  884.     RStringPtr                        recordType;
  885. };
  886.  
  887. typedef struct LocalRecordID LocalRecordID;
  888.  
  889. typedef LocalRecordID *LocalRecordIDPtr;
  890.  
  891. /* Create a LocalRecordID from a name, type, and CreationID */
  892. extern pascal void OCENewLocalRecordID(const RString *recordName, const RString *recordType, const CreationID *cid, LocalRecordID *lRID)
  893.  THREEWORDINLINE(0x303C, 798, 0xAA5C);
  894. /*
  895. Copy LocalRecordID lRID1 to LocalRecordID lRID2.  lRID2 must already contain
  896. pointers to RString structures large enough to hold copies of the corresponding
  897. fields from lRID1.  A memFull error will be returned if that is not the case.
  898. So if you allocate a brand new empty destination, you must at least set up
  899. its length field.
  900. */
  901. extern pascal OSErr OCECopyLocalRecordID(const LocalRecordID *lRID1, LocalRecordID *lRID2)
  902.  THREEWORDINLINE(0x303C, 770, 0xAA5C);
  903. /*
  904. Check the equality of two local RIDs.
  905. */
  906. extern pascal Boolean OCEEqualLocalRecordID(const LocalRecordID *lRID1, const LocalRecordID *lRID2)
  907.  THREEWORDINLINE(0x303C, 783, 0xAA5C);
  908. /**** ShortRecordID ****/
  909. struct ShortRecordID {
  910.     PackedRLIPtr                    rli;
  911.     CreationID                        cid;
  912. };
  913.  
  914. typedef struct ShortRecordID ShortRecordID;
  915.  
  916. typedef ShortRecordID *ShortRecordIDPtr;
  917.  
  918. /* Create a ShortRecordID from an RLI struct and a CreationID */
  919. extern pascal void OCENewShortRecordID(const PackedRLI *theRLI, const CreationID *cid, ShortRecordIDPtr sRID)
  920.  THREEWORDINLINE(0x303C, 801, 0xAA5C);
  921. /*
  922. Copy ShortRecordID sRID1 to ShortRecordID sRID2.  sRID2 must already contain
  923. pointers to structures large enough to hold copies of the corresponding
  924. fields from sRID1.  A memFull error will be returned if that is not the case.
  925. So if you allocate a brand new empty destination, you must at least set up
  926. its length fields.
  927. */
  928. extern pascal OSErr OCECopyShortRecordID(const ShortRecordID *sRID1, ShortRecordID *sRID2)
  929.  THREEWORDINLINE(0x303C, 778, 0xAA5C);
  930. /*
  931. Check the equality of two short RIDs.
  932. */
  933. extern pascal Boolean OCEEqualShortRecordID(const ShortRecordID *sRID1, const ShortRecordID *sRID2)
  934.  THREEWORDINLINE(0x303C, 791, 0xAA5C);
  935. /**** RecordID ****/
  936. struct RecordID {
  937.     PackedRLIPtr                    rli;                        /* pointer to a packed rli structure */
  938.     LocalRecordID                    local;
  939. };
  940.  
  941. typedef struct RecordID RecordID;
  942.  
  943. typedef RecordID *RecordIDPtr;
  944.  
  945. /*    Create a RecordID from a packed RLI struct and a LocalRecordID.
  946. This doesn't allocate any new space; the RecordID points to the same
  947. packed RLI struct and the same name and type RStrings. */
  948. extern pascal void OCENewRecordID(const PackedRLI *theRLI, const LocalRecordID *lRID, RecordID *rid)
  949.  THREEWORDINLINE(0x303C, 800, 0xAA5C);
  950. /*
  951. Copy RecordID RID1 to RecordID RID2.  RID2 must already contain
  952. pointers to structures large enough to hold copies of the corresponding
  953. fields from lRID1.  A memFull error will be returned if that is not the case.
  954. So if you allocate a brand new empty destination, you must at least set up
  955. its length fields.
  956. */
  957. extern pascal OSErr OCECopyRecordID(const RecordID *rid1, const RecordID *rid2)
  958.  THREEWORDINLINE(0x303C, 777, 0xAA5C);
  959. /*    Check the equality of two RIDs. */
  960. extern pascal Boolean OCEEqualRecordID(const RecordID *rid1, const RecordID *rid2)
  961.  THREEWORDINLINE(0x303C, 788, 0xAA5C);
  962. /**** PackedRecordID ****/
  963. /*
  964. struct PackedRecordID is a maximum-sized structure.  Allocate one of
  965. these and it will hold any valid packed RecordID.
  966. */
  967. #define PackedRecordIDHeader     \
  968.     unsigned short dataLength;
  969.  
  970. enum {
  971.     kPackedRecordIDMaxBytes        = (kPathNameMaxBytes + sizeof(DNodeNum) + sizeof(DirDiscriminator) + sizeof(CreationID) + (3 * sizeof(RString)))
  972. };
  973.  
  974. struct PackedRecordID {
  975.     unsigned short                    dataLength;
  976.     Byte                            data[kPackedRecordIDMaxBytes];
  977. };
  978.  
  979. typedef struct PackedRecordID PackedRecordID;
  980.  
  981. /*
  982. struct ProtoPackedRecordID is a minimum-sized structure.  Use this
  983. for a variable-length packed RecordID.
  984. */
  985. struct ProtoPackedRecordID {
  986.     unsigned short                    dataLength;
  987. };
  988.  
  989. typedef struct ProtoPackedRecordID ProtoPackedRecordID;
  990.  
  991. typedef PackedRecordID *PackedRecordIDPtr;
  992.  
  993. typedef ProtoPackedRecordID *ProtoPackedRecordIDPtr;
  994.  
  995. /*
  996. Copy PackedRecordID pRID1 to PackedRecordID pRID2.  pRID2 must already contain
  997. pointers to structures large enough to hold copies of the corresponding
  998. fields from pRID1.  A memFull error will be returned if that is not the case.
  999. pRID2Length is the number of bytes that can be put into pRID2, not counting the
  1000. packed RecordID header.
  1001. */
  1002. extern pascal OSErr OCECopyPackedRecordID(const PackedRecordID *pRID1, const PackedRecordID *pRID2, unsigned short pRID2Length)
  1003.  THREEWORDINLINE(0x303C, 774, 0xAA5C);
  1004. /*
  1005. Create a RecordID from a PackedRecordID.
  1006. NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE PACKED STRUCT - DON'T DELETE
  1007. OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED WITH THE UNPACKED STRUCT AS WELL
  1008. */
  1009. extern pascal void OCEUnpackRecordID(const PackedRecordID *pRID, RecordID *rid)
  1010.  THREEWORDINLINE(0x303C, 818, 0xAA5C);
  1011. /*
  1012. Create a PackedRecordID from a RecordID.  pRID must be large enough to contain
  1013. the packed RecordID.  A memFull error will be returned if that is not the case.
  1014. packedRecordIDLength is the number of bytes that can be put into pRID, not
  1015. counting the header.
  1016. */
  1017. extern pascal OSErr OCEPackRecordID(const RecordID *rid, PackedRecordID *pRID, unsigned short packedRecordIDLength)
  1018.  THREEWORDINLINE(0x303C, 806, 0xAA5C);
  1019. /*
  1020. Compute the number of bytes of memory needed to hold a RecordID when packed. This
  1021. length includes the length of the length field of PackedRecordID, so it
  1022. is safe to do a NewPtr (OCEPackedRecordIDSize(...)).
  1023. */
  1024. extern pascal unsigned short OCEPackedRecordIDSize(const RecordID *rid)
  1025.  THREEWORDINLINE(0x303C, 811, 0xAA5C);
  1026. /*
  1027. Check the equality of two packed RIDs.
  1028. */
  1029. extern pascal Boolean OCEEqualPackedRecordID(const PackedRecordID *pRID1, const PackedRecordID *pRID2)
  1030.  THREEWORDINLINE(0x303C, 786, 0xAA5C);
  1031. /* OCEValidPackedRecordID checks the validity of a packed record ID. */
  1032. extern pascal Boolean OCEValidPackedRecordID(const PackedRecordID *pRID)
  1033.  THREEWORDINLINE(0x303C, 821, 0xAA5C);
  1034. /**** DSSpec ****/
  1035. struct DSSpec {
  1036.     RecordID                        *entitySpecifier;
  1037.     OSType                            extensionType;
  1038.     unsigned short                    extensionSize;
  1039.     Ptr                                extensionValue;
  1040. };
  1041.  
  1042. typedef struct DSSpec DSSpec;
  1043.  
  1044. typedef DSSpec *DSSpecPtr;
  1045.  
  1046. /*
  1047. struct PackedDSSpec is NOT a maximum-sized structure.  Allocate one of
  1048. these and it will hold any valid packed RecordID, but not necessarily any additional
  1049. data.
  1050. */
  1051. #define PackedDSSpecHeader         \
  1052.     unsigned short dataLength;
  1053.  
  1054. enum {
  1055.     kPackedDSSpecMaxBytes        = (sizeof(PackedRecordID) + sizeof(OSType) + sizeof(UInt16))
  1056. };
  1057.  
  1058. struct PackedDSSpec {
  1059.     unsigned short                    dataLength;
  1060.     Byte                            data[kPackedDSSpecMaxBytes];
  1061. };
  1062.  
  1063. typedef struct PackedDSSpec PackedDSSpec;
  1064.  
  1065. /*
  1066. struct ProtoPackedDSSpec is a minimum-sized structure.  Use this
  1067. for a variable-length packed DSSpec.
  1068. */
  1069. struct ProtoPackedDSSpec {
  1070.     unsigned short                    dataLength;
  1071. };
  1072.  
  1073. typedef struct ProtoPackedDSSpec ProtoPackedDSSpec;
  1074.  
  1075. typedef PackedDSSpec *PackedDSSpecPtr;
  1076.  
  1077. typedef ProtoPackedDSSpec *ProtoPackedDSSpecPtr;
  1078.  
  1079. /*
  1080. Copy PackedDSSpec pdss1 to PackedDSSpec pdss2.  pdss2 must already contain
  1081. pointers to structures large enough to hold copies of the corresponding
  1082. fields from pdss1.  A memFull error will be returned if that is not the case.
  1083. pdss2Length is the number of bytes that can be put into pdss2, not counting the
  1084. packed DSSpec header.
  1085. */
  1086. extern pascal OSErr OCECopyPackedDSSpec(const PackedDSSpec *pdss1, const PackedDSSpec *pdss2, unsigned short pdss2Length)
  1087.  THREEWORDINLINE(0x303C, 771, 0xAA5C);
  1088. /*
  1089. Create a DSSpec from a PackedDSSpec.
  1090. NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE PACKED STRUCT - DON'T DELETE
  1091. OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED WITH THE UNPACKED STRUCT AS WELL.
  1092. A pointer to the extension is returned in dss->extensionValue, and the length of that
  1093. extension is returned in dss->extensionSize.  If there is no extension, dss->extensionValue will
  1094. be set to nil.  This routine will unpack the RecordID (if any) into rid, unpack the rest
  1095. into dss, and set dss->entitySpecifier to rid.
  1096. */
  1097. extern pascal void OCEUnpackDSSpec(const PackedDSSpec *pdss, DSSpec *dss, RecordID *rid)
  1098.  THREEWORDINLINE(0x303C, 815, 0xAA5C);
  1099. /*
  1100. Create a PackedDSSpec from a DSSpec.  pdss must be large enough to
  1101. contain the packed RecordID and any extension.  A memFull error will be returned if that
  1102. is not the case.  pdssLength is the number of bytes that can be put into pdss,
  1103. not counting the header.
  1104. */
  1105. extern pascal OSErr OCEPackDSSpec(const DSSpec *dss, PackedDSSpec *pdss, unsigned short pdssLength)
  1106.  THREEWORDINLINE(0x303C, 802, 0xAA5C);
  1107. /*
  1108. Compute the number of bytes of memory needed to hold a DSSpec when packed. This
  1109. length includes the length of the length field of PackedDSSpec, so it
  1110. is safe to do a NewPtr (OCEPackedDSSpecSize(...)).
  1111. */
  1112. extern pascal unsigned short OCEPackedDSSpecSize(const DSSpec *dss)
  1113.  THREEWORDINLINE(0x303C, 807, 0xAA5C);
  1114. /*    Check the equality of two DSSpecs.  This compares all fields, even the
  1115. extension (unless extensionSize == 0).  The extensions are compared in a case-insensitive and
  1116. diacrit-insensitive manner. */
  1117. extern pascal Boolean OCEEqualDSSpec(const DSSpec *pdss1, const DSSpec *pdss2)
  1118.  THREEWORDINLINE(0x303C, 782, 0xAA5C);
  1119. /*    Check the equality of two PackedDSSpecs.  This compares all fields, even the
  1120. extension (unless extensionSize == 0).  The extensions are compared in a case-insensitive and
  1121. diacrit-insensitive manner. */
  1122. extern pascal Boolean OCEEqualPackedDSSpec(const PackedDSSpec *pdss1, const PackedDSSpec *pdss2)
  1123.  THREEWORDINLINE(0x303C, 784, 0xAA5C);
  1124. /*
  1125. Check the validity of a PackedDSSpec.  If extensionType is
  1126. 'entn', pdss must contain a valid entitySpecifier.  For all other extensionTypes, a nil
  1127. entitySpecifier is valid, but if non-nil, it will be checked for validity.  No check
  1128. is made on the extension.
  1129. */
  1130. extern pascal Boolean OCEValidPackedDSSpec(const PackedDSSpec *pdss)
  1131.  THREEWORDINLINE(0x303C, 819, 0xAA5C);
  1132. /*
  1133. Return info about a DSSpec.  This routine does not check validity.  If the
  1134. DSSpec has no extension, we determine whether it represents the root of all
  1135. catalogs, a single catalog, a DNode, or a Record.  Else it is invalid.
  1136. If the DSSpec has an extension, we simply return the extension type.
  1137. */
  1138. extern pascal OSType OCEGetDSSpecInfo(const DSSpec *spec)
  1139.  THREEWORDINLINE(0x303C, 793, 0xAA5C);
  1140. /* OCEGetExtensionType returns the extensionType imbedded in the PackedDSSpec. */
  1141. extern pascal OSType OCEGetExtensionType(const PackedDSSpec *pdss)
  1142.  THREEWORDINLINE(0x303C, 796, 0xAA5C);
  1143. /*
  1144. OCEStreamPackedDSSpec streams (flattens) a catalog object a little at a time by
  1145. calling the DSSpecStreamer routine that you provide.
  1146. */
  1147. typedef pascal OSErr (*DSSpecStreamerProcPtr)(void *buffer, unsigned long count, Boolean eof, long userData);
  1148.  
  1149. #if GENERATINGCFM
  1150. typedef UniversalProcPtr DSSpecStreamerUPP;
  1151. #else
  1152. typedef DSSpecStreamerProcPtr DSSpecStreamerUPP;
  1153. #endif
  1154.  
  1155. enum {
  1156.     uppDSSpecStreamerProcInfo = kPascalStackBased
  1157.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  1158.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void*)))
  1159.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(unsigned long)))
  1160.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Boolean)))
  1161.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long)))
  1162. };
  1163.  
  1164. #if GENERATINGCFM
  1165. #define NewDSSpecStreamerProc(userRoutine)        \
  1166.         (DSSpecStreamerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDSSpecStreamerProcInfo, GetCurrentArchitecture())
  1167. #else
  1168. #define NewDSSpecStreamerProc(userRoutine)        \
  1169.         ((DSSpecStreamerUPP) (userRoutine))
  1170. #endif
  1171.  
  1172. #if GENERATINGCFM
  1173. #define CallDSSpecStreamerProc(userRoutine, buffer, count, eof, userData)        \
  1174.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDSSpecStreamerProcInfo, (buffer), (count), (eof), (userData))
  1175. #else
  1176. #define CallDSSpecStreamerProc(userRoutine, buffer, count, eof, userData)        \
  1177.         (*(userRoutine))((buffer), (count), (eof), (userData))
  1178. #endif
  1179.  
  1180. typedef DSSpecStreamerUPP DSSpecStreamer;
  1181.  
  1182. extern pascal OSErr OCEStreamPackedDSSpec(const DSSpec *dss, DSSpecStreamer stream, long userData, unsigned long *actualCount)
  1183.  THREEWORDINLINE(0x303C, 829, 0xAA5C);
  1184. /**** AttributeType ****/
  1185. /*
  1186. For the record, an AttributeType is an RString with a smaller maximum size.
  1187. I don't just typedef it to an RString, because I want the definition of the AttributeType
  1188. struct to contain the max length, because I need to include it in the Attribute struct
  1189. below.  But it should be possible to typecast any AttributeType to an RString and use
  1190. all the RString utilities on it.
  1191. */
  1192. struct AttributeType {
  1193.     CharacterSet                    charSet;
  1194.     unsigned short                    dataLength;
  1195.     Byte                            body[kAttributeTypeMaxBytes]; /* always fixed at the max size */
  1196. };
  1197.  
  1198. typedef struct AttributeType AttributeType;
  1199.  
  1200. typedef AttributeType *AttributeTypePtr;
  1201.  
  1202. /* Miscellaneous defines:  (these cannot be made into enums) */
  1203.  
  1204. enum {
  1205.     kMinPackedRStringLength        = (sizeof(ProtoRString))
  1206. };
  1207.  
  1208. enum {
  1209.     kMinPackedRLISize            = (sizeof(ProtoPackedRLI) + sizeof(DirDiscriminator) + sizeof(DNodeNum) + kMinPackedRStringLength + sizeof(ProtoPackedPathName))
  1210. };
  1211.  
  1212. typedef DescType AttributeTag;
  1213.  
  1214. struct AttributeValue {
  1215.     AttributeTag                    tag;
  1216.     unsigned long                    dataLength;
  1217.     Ptr                                bytes;
  1218. };
  1219.  
  1220. typedef struct AttributeValue AttributeValue;
  1221.  
  1222. typedef AttributeValue *AttributeValuePtr;
  1223.  
  1224. /**** Attribute ****/
  1225. struct Attribute {
  1226.     AttributeType                    attributeType;
  1227.     AttributeCreationID                cid;
  1228.     AttributeValue                    value;
  1229. };
  1230.  
  1231. typedef struct Attribute Attribute;
  1232.  
  1233. typedef Attribute *AttributePtr;
  1234.  
  1235. extern pascal RString *OCEGetIndRecordType(OCERecordTypeIndex stringIndex)
  1236.  THREEWORDINLINE(0x303C, 795, 0xAA5C);
  1237. extern pascal AttributeType *OCEGetIndAttributeType(OCEAttributeTypeIndex stringIndex)
  1238.  THREEWORDINLINE(0x303C, 794, 0xAA5C);
  1239.  
  1240. enum {
  1241.     _oceTBDispatch                = 0xAA5E
  1242. };
  1243.  
  1244.  
  1245. #if PRAGMA_IMPORT_SUPPORTED
  1246. #pragma import off
  1247. #endif
  1248.  
  1249. #if PRAGMA_ALIGN_SUPPORTED
  1250. #pragma options align=reset
  1251. #endif
  1252.  
  1253. #ifdef __cplusplus
  1254. }
  1255. #endif
  1256.  
  1257. #endif /* REZ */
  1258. #endif /* __OCE__ */
  1259.